Skip Desktop if it equals the home folder
authorMatthias Clasen <matthiasc@src.gnome.org>
Fri, 23 Jan 2009 06:00:44 +0000 (06:00 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 23 Jan 2009 06:00:44 +0000 (06:00 +0000)
svn path=/trunk/; revision=22192

ChangeLog
gtk/gtkfilechooserdefault.c

index 54422d1add5526a67ed1f36144fc460f5fb7ae2a..cc317f603e8bedc77cd0744ecdb7d23734d4e223 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-23  Matthias Clasen  <mclasen@redhat.com>
+
+       Skip Desktop if it equals the home folder
+       Patch by Christian Dywan
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_desktop): Skip
+       Desktop if it equals the home folder.
+
 2009-01-23  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 536965 – GtkPlug: crash on theme change
index 6725e980fa6912e5fccd6ca462f1b8ab4b6262cb..49d7471af40c061dd711c0f7096c6dcb6fbb9006 100644 (file)
@@ -1920,6 +1920,15 @@ shortcuts_append_desktop (GtkFileChooserDefault *impl)
   profile_start ("start", NULL);
 
   name = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
+  /* "To disable a directory, point it to the homedir."
+   * See http://freedesktop.org/wiki/Software/xdg-user-dirs
+   **/
+  if (!g_strcmp0 (name, g_get_home_dir ()))
+    {
+      profile_end ("end", NULL);
+      return;
+    }
+
   file = g_file_new_for_path (name);
   shortcuts_insert_file (impl, -1, SHORTCUT_TYPE_FILE, NULL, file, _("Desktop"), FALSE, SHORTCUTS_DESKTOP);
   impl->has_desktop = TRUE;